import { Table } from "antd";

import React, { useState, useRef, forwardRef } from "react";
const CommonTable = forwardRef((props, ref) => {
    const [tableHeight, setTableHeight] = useState(0);
    React.useImperativeHandle(ref, () => ({
        setTableHeight,
  }));
  const conTable = useRef(null);
  return (
    <div>
      <Table
        ref={conTable}
        dataSource={props.tableData}
        pagination={true}
        scroll={{ y: tableHeight }}
        {...props}
      />
    </div>
  );
});
export default CommonTable;